package com.angel.arquitectura.dao.factory;

import com.angel.arquitectura.dao.configuration.ConfigurationParameterDAO;
import com.angel.arquitectura.dao.language.LanguageDAO;
import com.angel.arquitectura.dao.user.ActionDAO;
import com.angel.arquitectura.dao.user.RoleDAO;
import com.angel.arquitectura.dao.user.UserDAO;
import com.angel.arquitectura.dao.user.UserRoleDAO;
import com.angel.dao.generic.factory.DAOFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 *
 * @author William
 * @since 05/April/2009
 */
@Component
public class ArquitecturaDAOFactory extends DAOFactory{

    private static ArquitecturaDAOFactory INSTANCE;

    @Autowired
    private ActionDAO actionDAO;
    @Autowired
    private UserDAO userDAO;
    @Autowired
    private RoleDAO roleDAO;
    @Autowired
    private UserRoleDAO userRoleDAO;
    @Autowired
    private LanguageDAO languageDAO;
    @Autowired
    private ConfigurationParameterDAO configurationParameterDAO;

    private ArquitecturaDAOFactory() {
        super();
    }

    public synchronized static ArquitecturaDAOFactory createInstance() {
        if (INSTANCE == null) {
            INSTANCE = new ArquitecturaDAOFactory();
        }
        return INSTANCE;
    }

    public UserDAO getUserDAO() {
        return INSTANCE.userDAO;
    }

    public void setUserDAO(UserDAO userDAO) {
        INSTANCE.userDAO = userDAO;
    }
    
    public RoleDAO getRoleDAO() {
        return INSTANCE.roleDAO;
    }

    public void setRoleDAO(RoleDAO roleDAO) {
        INSTANCE.roleDAO = roleDAO;
    }
    
    public ActionDAO getActionDAO() {
        return INSTANCE.actionDAO;
    }

    public void setActionDAO(ActionDAO accionDAO) {
        INSTANCE.actionDAO = accionDAO;
    }

    public UserRoleDAO getUserRoleDAO() {
        return INSTANCE.userRoleDAO;
    }

    public void setUserRoleDAO(UserRoleDAO userRoleDAO) {
        INSTANCE.userRoleDAO = userRoleDAO;
    }

    public ConfigurationParameterDAO getConfigurationParameterDAO() {
        return configurationParameterDAO;
    }

    public void setConfigurationParameterDAO(ConfigurationParameterDAO configurationParameterDAO) {
        this.configurationParameterDAO = configurationParameterDAO;
    }

    public LanguageDAO getLanguageDAO() {
        return languageDAO;
    }

    public void setLanguageDAO(LanguageDAO languageDAO) {
        this.languageDAO = languageDAO;
    }
}